<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | fastadmin: https://www.fastadmin.net/
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 邮箱验证码接口
// +----------------------------------------------------------------------
namespace app\api\controller;

use app\admin\model\UserModel;
use app\common\controller\Api;
use app\common\library\Wechat;
use think\Controller;
use think\Request;


class User extends Api
{
    protected $noNeedLogin = ['getPhone'];



    public function getUserInfo(){
        $data = (new \app\common\model\UserModel())->getUserInfo($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

    /*
     * 个人信息
     */
    public function saveInfo(Request $request)
    {
        $data = (new \app\common\model\UserModel())->saveInfo($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function saveCard(Request $request)
    {
        $data = (new \app\common\model\UserModel())->saveCard($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function getCard(Request $request)
    {
        $data = (new \app\common\model\UserModel())->getCard($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

    public function deleteCard(){
        $data = (new \app\common\model\UserModel())->deleteCard($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function deleteAlipay(){
        $data = (new \app\common\model\UserModel())->deleteAlipay($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

    public function getAlipay(Request $request)
    {
        $data = (new \app\common\model\UserModel())->getAlipay($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function saveAliPay(Request $request)
    {
        $data = (new \app\common\model\UserModel())->saveAlipay($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function problem(Request $request)
    {
        $data = (new \app\common\model\UserModel())->problem($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }



    public function loginOut(){
        $data = (new \app\common\model\UserModel())->loginOut($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

    public function getPhone(){
        $data = (new \app\common\model\UserModel())->getPhone();
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function getIncomeList(){
        $data = (new \app\common\model\UserModel())->getLists($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

}
